package packet

import (
	"encoding/hex"
	"hy_808/protocol/hygprs"
	"strings"
	"time"
)

/*

##调度业务端登录包##
b0
00 19
02
00 00
a2
01 00 01 86 a1		# (线路号52)
02 00 01 86 a1 		# (车号41121)
1a 01
f1 00 00 04 cc
b1

*/

type ScheduleServerLogin struct {
	hygprs.Fields
}

func GenScheduleServerLogin(line int) (p ScheduleServerLogin) {
	data, _ := hex.DecodeString(strings.ReplaceAll("B0 00 19 02 00 00 A2 01 00 01 86 A1 02 00 01 86 A1 1A 01 F1 00 00 04 CC B1 ", " ", ""))
	sc := ScheduleServerLogin{hygprs.MakeFields(hygprs.MakePacket(data))}
	sc.SetLineID(uint32(line))
	//sc.SetBusID(uint32(bus))
	sc.SetUnix(uint32(time.Now().Unix()))
	sc.Pack()
	return sc
}
